package com.example.monstercatch;

import java.util.List;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Rect;

import com.game.ThauanFramework.GameObject;

public class ImageButton extends GameObject {

	private Rect destRect;
	private Rect srcRect;
	private Bitmap bitmap;
	
	public ImageButton(Bitmap bitmap, Rect rect, List<GameObject> go) {
		
		this.bitmap = bitmap;
		this.destRect = rect;
		this.srcRect = new Rect(0,0,bitmap.getWidth(), bitmap.getHeight());
		
		go.add(this);
	}
	
	public boolean onTap(int x, int y)
	{
		if(this.destRect.contains(x, y))
		{
			return true;
		}
		
		return false;
	}

	@Override
	public void Update() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void Draw(Canvas canvas) {
		
		canvas.drawBitmap(bitmap, srcRect, destRect, MinhasCoisas.getPaint());
		
	}

	@Override
	public void Die() {
		
	}

	@Override
	public void Destroy() {
		
	}

}
